url.exists <- function(url) {
    identical(httr::status_code(httr::HEAD(url)), 200L)
}

check_url <- function(url) {
    idx <- vapply(url, url.exists, logical(1))
    url[!idx] <- NA
    return(url)
}

zeroGrob <- function() .zeroGrob

.zeroGrob <- grid::grob(cl = "zeroGrob", name = "NULL")

widthDetails.zeroGrob <- function(x) unit(0, "cm")
heightDetails.zeroGrob <- function(x) unit(0, "cm")
grobWidth.zeroGrob <- function(x) unit(0, "cm")
grobHeight.zeroGrob <- function(x) unit(0, "cm")
drawDetails.zeroGrob <- function(x, recording) {}
